/* **********************************************************************************
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* **********************************************************************************/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Theme_Builder
{
    /// <summary>
    /// Allows the ability to edit (a subset of) modifications that can be applied to a color
    /// </summary>
    public partial class EditColorMods : UserControl
    {
        public EditColorMods()
        {
            InitializeComponent();
        }

        public ColorMods ColorModifications
        {
            get
            {
                ColorMods mods = new ColorMods();

                mods.alpha = Double.Parse(this.textBoxAlpha.Text);
                mods.tint = Double.Parse(this.textBoxTint.Text);
                mods.shade = Double.Parse(this.textBoxShade.Text);
                mods.hueMod = Double.Parse(this.textBoxHueMod.Text);
                mods.satMod = Double.Parse(this.textBoxSatMod.Text);
                mods.lumMod = Double.Parse(this.textBoxLumMod.Text);

                return mods;
            }
            set
            {
                ColorMods mods = (ColorMods)value;

                this.textBoxAlpha.Text = mods.alpha.ToString();
                this.textBoxHueMod.Text = mods.hueMod.ToString();
                this.textBoxLumMod.Text = mods.lumMod.ToString();
                this.textBoxSatMod.Text = mods.satMod.ToString();
                this.textBoxShade.Text = mods.shade.ToString();
                this.textBoxTint.Text = mods.tint.ToString();
            }
        }
    }
}
